/**
 * Created by home on 2017/8/19.
 */
var mysql=require("mysql");
var pool=mysql.createPool({
    host:"127.0.0.1",
    user:"root",
    password:"",
    database:"myl"
});
function query(sql,callback){
    pool.getConnection(function(err,connection){
        console.log("connection==>",connection);
        connection.query(sql,function(err,rows){
            callback(err,rows);
            connection.release();
        })
    })
}
exports.query=query;